from odoo import api, models, fields, _
from odoo.exceptions import ValidationError
from odoo.tools.float_utils import float_compare


class WorkorderDoneLineQty(models.TransientModel):
    _inherit = 'workorder.done.line.qty'

    # def done_move_qty(self):
    #     """成品检修，自动验证检修的自动调拨单"""
    #     res = super().done_move_qty()
    #     production = self.workorder_id.production_id
    #     if production.state == 'done' and production.origin and 'ReworkCheck' in production.origin:
    #         rework_check_id = production.origin.split('/')[-1]
    #         rec = self.env['s.rework.check'].search([('id', '=', int(rework_check_id))], limit=1)
    #         rec.mapped('picking_ids').button_validate()
    #     return res
